package main

import "fmt"

// Book 定义一个结构体
type Book struct {
	title string
	auth  string
}

func changeBook1(book Book){
	// 传递book副本
	book.auth = "66666"
}

func changeBook2(book *Book){
	// 指针传递
	book.auth = "7777"
}

func main() {
	var book1 Book
	book1.title = "Golang"
	book1.auth = "zhangsan1"
	fmt.Printf("%v\n", book1)

	changeBook1(book1)
	fmt.Printf("%v\n", book1)

	changeBook2(&book1)
	fmt.Printf("%v\n", book1)

}
